<template>
    <ul class="todo-main">
        <!-- 不指定key会报错 -->
        <MyItem v-for="todoObj in todoObjs" :key="todoObj.id" :todoObj="todoObj"/>
    </ul>
</template>

<script>
import MyItem from './MyItem.vue'
export default {
    name: 'MyList',

    data() {
        return {
            todoObjs: [//status布尔值不能使用字符串，否则都是true
                {
                    id: '001',
                    title: '原神',
                    status: true
                },
                {
                    id: '002',
                    title: '皇室战争',
                    status: false
                },
                {
                    id: '003',
                    title: '王者荣耀',
                    status: true
                }
            ]
        };
    },

    mounted() {
        
    },

    methods: {
        
    },
    components:{
        MyItem
    }
};
</script>

<style scoped>
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}
</style>